<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<jsp:include page="global.jsp"></jsp:include>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>人员任务</title>
<style type="text/css">
.ctl{
	text-decoration: none;
	color: blue;
	margin: auto 7px;
}
.ctl:HOVER{
	text-decoration: underline;
}
.center{
	text-align: center;
}
</style>
</head>
<body>
	<table id="dg" class="easyui-datagrid" title="人员任务"
			data-options="
				rownumbers:true,
				iconCls: 'icon-edit',
				singleSelect: true,
				toolbar: '#tb',
				singleSelect:true,
				pagination:true,
				fit:true,
				fitColumns:true,
				pageList:[20,25,30,35,40,45,50],
				pageSize:20
			">
		<thead>
			<tr>
				<th data-options="field:'name',width:200,align:'center'">姓名</th>
				<th data-options="field:'departmentName',width:200,align:'center'">所属部门</th>
				<th data-options="field:'positionName',width:200,align:'center'">岗位</th>
				<th data-options="field:'technicalTitleName',width:200,align:'center'">技术职位</th>
				<th data-options="field:'id',width:50,align:'center',formatter:formatControl">查看</th>
			</tr>
		</thead>
	</table>

	<div id="tb" style="height:auto">
		<div>
			所属部门名称:
			<select data-options="editable: false" id = "departmentId" class="easyui-combobox">
				<option value = ""> --全部-- </option>
				<c:forEach var="item" items="${departments }" >
					<option value = "${item.id }">${item.name }</option>
				</c:forEach>
			</select>
			岗位名称:
			<select data-options="editable: false" id = "positionId" class="easyui-combobox">
				<option value = ""> --全部-- </option>
				<c:forEach var="item" items="${positions }" >
					<option value = "${item.id }">${item.name }</option>
				</c:forEach>
			</select>
			技术职位名称:
			<select data-options="editable: false" id = "technicalTitleId" class="easyui-combobox">
				<option value = ""> --全部-- </option>
				<c:forEach var="item" items="${technicalTitles }" >
					<option value = "${item.id }">${item.name }</option>
				</c:forEach>
			</select>
			姓名: <input class="easyui-textbox" type="text" id="name" style="width:100px;height:25px;">
			<a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
		</div>
	</div>
	
	
	<div id="lookDetail" class="easyui-window" title="任务信息" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:1100px; height:600px;padding:0px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:0px;">
				<iframe id="detail" width="100%" height="100%" frameborder="0"></iframe>
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookDetail').window('close')" style="width:80px">关 闭</a>
			</div>
		</div>
	</div>
	
	<script type="text/javascript">
		function formatControl(val, row){
			return '<a class="ctl" href="javascript:void(0)" onclick="lookDetail(' + val + ')">任务信息</a>';
		}
		function lookDetail(id){
			var url = "lookPeopleTaskDetail?id=" + id;
			$("#detail").attr("src", url);
			$('#lookDetail').window('open');
		}
		function search(){
			var dg = $("#dg");
			var name = $("#name").textbox("getValue").trim();
			var	departmentId = $("#departmentId").combobox("getValue");
			var positionId = $("#positionId").combobox("getValue");
			var	technicalTitleId = $("#technicalTitleId").combobox("getValue");
			var url = "queryPeople?name=" + name + "&departmentId=" + departmentId + "&positionId="+positionId + "&technicalTitleId=" + technicalTitleId;
			dg.datagrid('reload', url);
		}
		
		$(function(){
			search();
		});
	</script>
</body>
</html>